# sudo -i

# 先安装Python的软件仓库支持
sudo apt-get install -y software-properties-common
sudo apt-get install -y python-software-properties 

# 增加nodejs 的仓库配置 
sudo add-apt-repository ppa:chris-lea/node.js -y
# 更新APT 仓库缓存 
sudo apt-get update  -y

# 安装nodejs
sudo apt-get install -y nodejs  
nodejs -v
# 安装python
sudo apt-get install -y python3
sudo apt-get install -y python3-pip
sudo cp /usr/bin/python3 /usr/bin/python

# 安装 dotnet core
sudo apt-get install -y wget
wget https://packages.microsoft.com/config/ubuntu/20.04/packages-microsoft-prod.deb -O packages-microsoft-prod.deb
sudo dpkg -i packages-microsoft-prod.deb
rm packages-microsoft-prod.deb
sudo apt-get update
sudo apt-get install -y apt-transport-https
sudo apt-get update
sudo apt-get install -y dotnet-sdk-6.0
sudo apt-get install -y dotnet-sdk-7.0
sudo apt-get install -y dotnet-sdk-8.0
sudo apt-get install -y aspnetcore-sdk-6.0
sudo apt-get install -y aspnetcore-sdk-7.0
sudo apt-get install -y aspnetcore-sdk-8.0
# sudo apt-get install -y dotnet-runtime-6.0
# sudo apt-get install -y dotnet-runtime-7.0
# sudo apt-get install -y aspnetcore-runtime-6.0
# sudo apt-get install -y aspnetcore-runtime-7.0

# 安装 ASP.NET Core 7.0 运行时：aspnetcore-runtime-7.0
# 安装 .NET Core 2.1 运行时：dotnet-runtime-2.1
# 安装 .NET 5 SDK：dotnet-sdk-5.0
# 安装 .NET Core 3.1 SDK：dotnet-sdk-3.1

# 安装 scripts
sudo apt install mono-devel -y
sudo wget -q https://github.com/scriptcs/scriptcs/archive/refs/tags/v0.17.1.tar.gz -O scriptcs.tar.gz
sudo tar -zxvf scriptcs.tar.gz
cd scriptcs-0.17.1
chmod +x build.sh
sudo ./build.sh
dotnet tool install -g dotnet-script
echo 'export PATH=$PATH:~/.dotnet/tools' >> ~/.bashrc
source ~/.bashrc